/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86186
 * Date: 2023-08-19
 * Time: 12:30
 */
class MyThread extends Thread {
    @Override
    public void run() {
        System.out.println("hello mythread!");
    }
}

class MyRunnable implements Runnable {
    @Override
    public void run() {
        System.out.println("hello mythread");
    }
}

public class ThreadDemo {
    public static void main(String[] args) {
        //1.Thread t = new MyThread();
        //2.Thread t = new Thread(new MyRunnable());
//        3.Thread t = new Thread() {
//            @Override
//            public void run() {
//                System.out.println("hello mythread!");
//            }
//        };

//        4.Thread t = new Thread(new Runnable() {
//            @Override
//            public void run() {
//                System.out.println("hello mythread!");
//            }
//        });

        Thread t = new Thread(() -> {
            System.out.println("hello mythread!");
        });

    }
}
